/**
 * 
 */
package autil;

/**
 * @author liutao
 *
 */
public class State {
	public int daysuserd = 0;//continued days
	public int mainstate = 0;//0=free 1=semibusy 2=busy means cpu and network 
	public String currentuser = "empty";
	public void getState()// init state
	{
		this.currentuser = InfoReporter.getCurUser();
		double cupration = CpuReporter.getCpuRatioForWindows();
		if(!NetWorkReporter.getWwwState()&&NetWorkReporter.getLanState())
		{
			this.mainstate = 1;
		}
		else
		{
			if(cupration>0.49)
			{
				this.mainstate = 2;
			}
			else
			{
				this.mainstate = 0;
			}
		}
		return;
	}
	
	@Override
	public String toString() {
		return "State [daysuserd=" + daysuserd + ", mainstate=" + mainstate+""
				+ ", currentuser=" + currentuser + "]";
	}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
